package com.ftg.learn.chapter08.interface1.dictionary;

/**
 * 中韩词典
 *
 * @author lijiaxin
 * @version 1.0
 * @date 2023/7/27 10:22
 */

public class ZhKeo extends DicParent implements DicInterface{


    @Override
    public String findWord(String key) {
        for (int es = 0; es < super.getEs().length; es++) {
            if(super.getEs()[es].getZh().equals(key)){
                return super.getEs()[es].getKeo();
            }
        }
        return "对不起";
    }

    public static void main(String[] args) {
        DicInterface ze = new ZhKeo();
        System.out.println(ze.findWord("中国"));

        DicInterface di = new ZhEnDic();
        System.out.println(di.findWord("中国"));
    }
}
